<template>
  <h3>子组件</h3>
  <div>玩具车:{{ toy }}</div>
  <button @click="send">传给父</button>
</template>

<script setup>
  import { ref } from "vue";

  let toy = ref('玩具车')

  const emit = defineEmits(['send-toy'])

  console.log('emit--', emit)

  function send () {
    emit('send-toy', toy.value)
  }
</script>

<style>
</style>